package com.bridgeintelligent.tag.webserver.dim.query.service;

import com.bridgeintelligent.tag.webserver.dim.query.api.CommonRsp;
import com.bridgeintelligent.tag.webserver.dim.query.api.CustQuerySetRsp;
import com.bridgeintelligent.tag.webserver.dim.query.api.CustomerGroupRsp;
import com.bridgeintelligent.tag.webserver.dim.query.api.service.IQueryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @description
 * @author: grp 2020-07-23 17:49
 **/
@Service
@Slf4j
@AllArgsConstructor
public class QueryService implements IQueryService {

    private QueryApiUtils queryApiUtils;

    @Override
    public CustomerGroupRsp customerGroup(String config) {
        QueryApi queryApi = queryApiUtils.build(QueryApi.class);
        return queryApi.customerGroup(config);
    }

    @Override
    public CustQuerySetRsp custQuery(String config) {
        QueryApi queryApi = queryApiUtils.build(QueryApi.class);
        return queryApi.custQuery(config);
    }

    @Override
    public CommonRsp refresh() {
        QueryApi queryApi = queryApiUtils.build(QueryApi.class);
        return queryApi.refresh();
    }


}
